import java.util.*;

public class _2023_10_13 {
    public boolean checkWon(int[][] board) {
       int n = board.length;
       int m = board[0].length;
       for(int i = 0; i < n; i++){
           if(board[i][0] == board[i][1] && board[i][1] == board[i][2] && board[i][1] == 1){
               return true;
           }
       }

        for(int i = 0; i < m; i++){
            if(board[0][i] == board[1][i] && board[1][i] == board[2][i] && board[1][i] == 1){
                return true;
            }
        }

        if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && board[1][1] == 1){
            return true;
        }
        if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && board[1][1] == 1){
            return true;
        }
        return false;
    }

    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        int score = check(arr);
        if(score >= 90){
            System.out.println("VERY_SECURE");
        }else if(score >= 80){
            System.out.println("SECURE");
        }else if(score >= 70){
            System.out.println("VERY_STRONG");
        }else if(score >= 60){
            System.out.println("STRONG");
        }else if(score >= 50){
            System.out.println("AVERAGE");
        } else if (score >= 25) {
            System.out.println("WEAK");
        }else{
            System.out.println("VERY_WEAK");
        }
    }

    private static int check(char[] arr){
        int ret = 0;
        int n = arr.length;

        if(n <= 4){
            ret += 5;
        }else if(n >= 5 && n <= 7){
            ret +=10;
        }else{
            ret += 25;
        }

        int t1 = 0; //数字
        int t2 = 0; //小写字母
        int t3 = 0; //大写字母
        int t4 = 0; //符号

        for(Character e : arr){
            if(e >= '0' && e <= '9'){
                t1++;
            }else if(e >= 'a' && e <= 'z'){
                t2++;
            }else if(e >= 'A' && e <= 'Z'){
                t3++;
            }else if(e >= 0x21 && e <= 0x2f || e >= 0x3A && e <= 0x40 || e >= 0x5B && e <= 0x60 || e >=0x7B && e <= 0x7E) {
                t4++;
            }
        }

        if(t1 == 1){
            ret += 10;
        }else if(t1 > 1){
            ret += 20;
        }

        if(t2 + t3 == 0){

        }else if(t2 != 0 && t3 == 0 || t2 == 0 && t3 != 0){
            ret += 10;
        }else {
            ret += 20;
        }

        if(t4 == 1){
            ret += 10;
        }else if(t4 > 1){
            ret += 20;
        }

        if(t2 != 0 && t3 != 0 && t1 != 0 && t4 != 0){
            ret += 5;
        }else if(t1 != 0 && t4 != 0 && t2 + t3 != 0){
            ret += 3;
        }else if(t1 != 0 && t2 + t3 != 0){
            ret += 2;
        }

        return ret;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int l = -1;
            int r = 0;
            int i = 0;
            LinkedList<Integer> arr = new LinkedList<>();
            for(i = 0; i < 32; i++){
                if((n & (1 << i)) != 0){
                    arr.add(1);
                }else{
                   arr.add(0);
                }
            }

            System.out.println(arr.size());

            int ans = 0;
            for(r = 0; r < 32; r++){
                if(arr.get(r) == 1){
                    ans = Math.max(ans, r - l);
                }else{
                    l = r;
                }
            }
            ans = Math.max(ans, r - l);
            System.out.println(ans);
        }
    }
}
